import Vue from 'vue'
import VueRouter from 'vue-router'

// import Home from '@/views/Home.vue'


Vue.use(VueRouter)

// 路由相关信息
const routes = [
  {
    path: '/',
    redirect:'/home'
  },
    {
      path: '/home',
      component: () => import('@/views/Main.vue'),
      // redirect:'/home',
      children: [
        {
              path: '/home',
              component:()=> import('@/views/Home')
        },
        {
          path: '/brand',
          component:()=>import('@/views/Brand/brandView.vue')
        },
        {
          path: '/userhome/:userId',
          name:'userhome',
          component: () => import('@/views/User/userHome.vue'),
          // children: [
          //   {
          //     path: '/business',
          //     component:()=> import('@/views/User/business/Bussiness.vue')
          //   },
          //   {
          //     path: '/customer',
          //     component:()=> import('@/views/User/customer/Customer.vue')
          //   },
          // ]
        },
        {
          path: '/ordergoods',
          component:()=>import('@/views/Order/orderGoods.vue')
        }
      ]
      
    },    
]
// 对router进行相关配置
const router = new VueRouter({
    mode: 'history',
    routes  
})

export default router